package ru.papergames.model.binsocket.packets.response
{
	import ru.papergames.model.binsocket.data.ExtByteArray;
	import ru.papergames.model.binsocket.packets.SocketResponse;

	public class MessageFromWebServerResponse extends SocketResponse
	{		
		public static const NOTIFICATION:String = 'MessageFromWebServerResponse';
		
		public var time:Number;
		public var isPrivate:Boolean = false;
		public var message:String;
		
		public function MessageFromWebServerResponse(bytes:ExtByteArray)
		{
			super(bytes);
		}
		
		override protected function decode():void {			
			
			time = binaryData.readLong();
			isPrivate = binaryData.readBoolean();	
			message = binaryData.readUTF();				
		}
		
		override public function getNotification():String {
			return NOTIFICATION;
		}
		
		public function get isSystemXML():Boolean {
			return message.indexOf('<res>') != -1;
		}
	}
}